-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable strict concurrency #14
Conversation
Xcode 15 triggers concurrency warnings that are no longer triggered in Xcode 16 beta 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the improvements @Supereg!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
==========================================
+ Coverage 90.69% 91.34% +0.66%
==========================================
Files 8 8
Lines 279 300 +21
==========================================
+ Hits 253 274 +21
Misses 26 26
Continue to review full report in Codecov by Sentry.
|
# Lie to the Swift compiler about isolation ## ♻️ Current situation & Problem In PR #14 we truthfully implemented strict concurrency checking for the XCTRuntimeAssertions library. However, this made it impossible to test runtime precondition failures on the `@MainActor` as it would completely block the actor (or the Task would only be scheduled after the `XCTRuntimePrecondition` call returned). Therefore, it is necessary to always run `XCTRuntimePrecondition` expressions on a background thread. If we would keep correct `@Sendable` annotations for the expression closure, this would make it impossible to run `XCTRuntimePrecondition`s on the `@MainActor`. Therefore, we lie to the compiler. We deliberately don't annotate the expression closure as `@Sendable` and silence the respective concurrency warning. The impact of that is documented. ## ⚙️ Release Notes * Restore testing preconditions which are annotated to be isolated to the `@MainActor`. ## 📚 Documentation Add documentation bubbles to explain the impact. ## ✅ Testing Add unit testing to prevent regressions. ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
Enable strict concurrency
♻️ Current situation & Problem
This PR enables strict concurrency for the project and fixes resulting concurrency warnings.
⚙️ Release Notes
📚 Documentation
--
✅ Testing
--
Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: